#include <windows.h>
#include <iostream>
#include "MainWindow.h"
#include "RenderDevice.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  {
  std::cout << hInstance;
  std::cout << hPrevInstance;
  std::cout << lpCmdLine;
  std::cout << nCmdShow;
  MainWindow main_window;
  RenderDevice render_device;
	if(!main_window.Init(hInstance))
	  {
		::MessageBox(0, "Window init failed", 0, 0);
		return 0;
	  }	
  if(!render_device.Init(main_window.GetWindowHandle()))
	  {
		::MessageBox(0, "Init Direct3D failed", 0, 0);
		return 0;
	  }	

  main_window.SetRenderDevice(&render_device);  
	main_window.enterMessageLoop();	
  return 0;
  }
